﻿namespace FSLib

module Labo =
    /// 簡単なメッセージを返す
    let FsMessage = "Hello, FSharp."


module CompareCSFS =

    // ----[C#]--------------------------------------------------------
    // int square(int x) { return x * x; }
    // int squareSum(int[] numbers)
    // {
    //     int total = 0;
    //     foreach(int num in numbers)
    //     {
    //         total += square(num);
    //     }
    //     return total;
    // }
    // ----------------------------------------------------------------
    let square x = x * x
    let squareSum numbers =
        numbers
        |> Seq.map square
        |> Seq.sum

    // Test code.
    let numbers = [1..10]
    printfn "squareSum [1..10] = %A" (squareSum numbers)



    // ----[C#]--------------------------------------------------------
    // ----------------------------------------------------------------






    // ----[C#]--------------------------------------------------------
    // ----------------------------------------------------------------

